#!/bin/bash
path='/home/muyi/catmd5'
sudo apt-get update
sudo apt-get install -y gcc make build-essential libssl-dev zlib1g-dev \
  libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
  libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
cd ${path} && mkdir .venv && tar -Jxvf Python-3.8.15.tar.xz && cd Python-3.8.15
sudo ./configure --enable-optimizations --prefix=/home/muyi/catmd5/.venv
cd ${path}/Python-3.8.15 && sudo make && sudo make install
sudo /home/muyi/catmd5/.venv/bin/python3.8 -m pip install --upgrade pip -i https://pypi.douban.com/simple/
cd ${path} && sudo cp -rpf site.py .venv/lib/python3.8/ && rm -rf site.py
cd ${path} && sudo .venv/bin/pip3 install paramiko pandas nuitka -i https://pypi.douban.com/simple/
#cd ${path} && sudo .venv/bin/python3.8 -m nuitka --windows-disable-console --nofollow-imports --show-memory --show-progress --output-dir=out map_md5.py
#cd ${path} && sudo .venv/bin/python3.8 -m nuitka --windows-disable-console --nofollow-imports --show-memory --show-progress --output-dir=out ros_md5.py
#cd ${path} && sudo .venv/bin/python3.8 -m nuitka --windows-disable-console --nofollow-imports --show-memory --show-progress --output-dir=out check_cross.py
#cd ${path} && sudo .venv/bin/python3.8 -m nuitka --module --show-progress --output-dir=m cmd_line.py
#cd ${path}/out && cp -rpf map_md5.bin check_cross.bin ros_md5.bin ../
#cd ${path}/m && cp -rpf cmd_line.cpython-38-x86_64-linux-gnu.so ../
#cd ${path} && cp -rpf cmd_line.cpython-38-x86_64-linux-gnu.so clientport/lib
cd ${path} && sudo rm -rf setup.sh Python-3.8.15.tar.xz Python-3.8.15
chmod +111 ${path}/check_cross.py
chmod +111 ${path}/map_md5.py
chmod +111 ${path}/ros_md5.py
